module.exports = {
  nav_name: '轮播图管理', //生成导航菜单
  module_name: 'banner_manager',  //生成路径，与模块名相同
  api: `{
    page: commonPath + "/admin/banner/pageSearch", // 分页
    detail: commonPath + '/admin/banner/get', //详情
    add: commonPath + '/admin/banner/save',  //添加
    edit: commonPath + "/admin/banner/edit", //编辑
    changeState: commonPath + '/admin/banner/editState', //状态编辑
    del: commonPath + "/admin/banner/remove", //删除
  }`,
  table: {
    nav_name: "轮播图列表",
    tipsText: "轮播图管理 >> 轮播图列表",
    //获取列表页面
    tableData: [
      { title: '序号', name: 'index', type: "normal" },
      // { title: '名称', name: 'goodId', type: "normal", showObj: "{}" },
      { 
        title: '缩略图', 
        name: 'imgUrl', 
        type: "img", 
        heightVal: "60", 
        widthVal: "100",
      },
      {
        title: '位置',
        name: 'type',
        type: "opts",
        showName: "typeShow",
        showObj: `{
          "1": "首页",
          "2": "商学院"
        }`
      },
      {
        title: '状态', 
        name: 'state',
        type: "opts",
        showName: "stateShow",
        showObj: `{
        "1": "上架",
        "2": "下架"
      }`
      },
      { title: '添加时间', name: 'gmtModified', type: "normal", showObj: "{}" },
    ],
    tableOpt: [
      {
        type: "changeState",
        text: "上架",
        request: true,
        url: "API.banner_manager.changeState",
        requestType: 'post',
        params: `{id,  state: 1 }`, //必须为文本
        methodNameTag: 'Open', //方法衔接拓展名 changeState Black
        showCondition: `scope.row.state == '2'`,  //展示条件，没有就不传或置为空
      },
      {
        type: "changeState",
        text: "下架",
        request: true,
        url: "API.banner_manager.changeState",
        requestType: 'post',
        params: `{id,  state: 2 }`, //必须为文本
        methodNameTag: 'Close', //方法衔接拓展名 changeState Black
        showCondition: `scope.row.state == '1'`,  //展示条件，没有就不传或置为空
      },
      {
        type: "modify",
        text: "编辑",
        request: false,
        jump: "/banner_manager_add_page"
      },

      {
        type: "del",
        text: "删除",
        request: true,
        url: "API.banner_manager.del",
        requestType: 'get',
      },

    ],
    search: {
      contentArr: {
        // select1: {
        //   labelName: '上架状态',
        //   inputName: 'sex',  //输入绑定的变量
        //   selectOptsName: "sexOpts",
        //   selectOptsArr: `[
        //   { value: "1", label: "上架" },
        //   { value: "2", label: "下架" },
        //   { value: "", label: "全部" },
        // ],
        // `, //选项数组
        // },
        // input1: { labelName: '名称', inputName: 'tel' },

      },
      // searchBtn: {
      //   text: "查询", //链接与table请求接口相同，不做另外配置
      // },
      addBtn: {
        //搜索栏具有添加功能按钮时，设置此字段
        type: "add",
        text: "添加",
        request: false,
        jump: "/banner_manager_add_page"
      }
    },
  },



  //添加页面
  add_page: {
    tipsText: "轮播图管理 >> 轮播图",
    formData: {
      titleText: "请填写轮播图相关信息",
      // input1: {
      //   labelName: '轮播图名称',
      //   inputName: "",
      //   isNeed: 'true',
      // },
      //图片上传
      uploadImg1: {
        labelName: "轮播图素材",
        inputName: "imgUrl",
        type: "many", //type: "single"
        countLimit: "1",
        uploadMethod: "handleUploadLogo",
        isNeed: 'true',
      },
      //轮播图状态
      radio1: {
        labelName: '轮播图状态',
        inputName: 'state',
        radioOpts: [
          { value: "1", label: "上架" },
          { value: "2", label: "下架" },
        ], //这是个同select结构的枚举,但为对象格式
        isNeed: 'true',
        radioWidth: '60px',
        // defaultValue: "", //初始默认值
      },
      //选择
      select1: {
        labelName: '轮播图位置',
        inputName: 'type',  //输入绑定的变量
        selectOptsName: "typeOpts",
        selectOptsArr: `[
            { value: "1", label: "首页" },
            { value: "2", label: "商学院" },
            { value: "", label: "全部"},
          ],
          `, //选项数组
        isNeed: 'true',
      },
      input2: {
        labelName: '轮播图链接',
        inputName: 'jumpUrl',
        // isNeed: 'true',
      },
    },
    addBtn: {
      text: '立即添加',
      url: "API.banner_manager.add"
    },
    editBtn: {
      text: '编辑',
      detailUrl: "API.banner_manager.detail",
      editUrl: "API.banner_manager.edit",
      isSplitSearchString: 'true', //列表拼接查询字符串
      jump: '/banner_manager_table'
    },
    cancelBtn: { text: "取消" }, //
  },

  //

  // //详情页面
  // detail_page: {

  // }
}
